Skip to main content
Version: older

v3.5.2 to v3.6.0

WARNING

You should now use the V3.6.1 else you can have problem with the NotificationTeamDto (format change)

AUTOMATIC MIGRATION

  1. Use the BIAToolKit to migrate the project

  2. Manage the conflict (2 solutions)

    1. In BIAToolKit click on "4 - merge Rejected" and search <<<<< in all files.
    • Resolve the c manually.
    1. Analyze the .rej file (search "diff a/" in VS code) that have been created in your project folder
    • Apply manually the change.
  3. Download, change source path and run the script V3.5.2_to_V3.6.0_Replacement.ps1

    1. The Das function in front take now objects the script apply the correct change

    2. The bia-table tag parameters change : 'canEdit' is replaced by 'canClickRow' 'edit' is replaced by 'clickRow'

    3. The bia domain and features have change the script do the following replacement: replace /domains/app-settings/ by /domains/bia-domains/app-settings/ replace /domains/language-option/ by /domains/bia-domains/language-option/ replace /domains/notification/ by /domains/bia-domains/notification/ replace /domains/notification-type-option/ by /domains/bia-domains/notification-type-option/ replace /domains/role-option/ by /domains/bia-domains/role-option/ replace /domains/team/ by /domains/bia-domains/team/ replace /domains/user-option/ by /domains/bia-domains/user-option/

      replace /features/background-task/ by /features/bia-features/background-task/ replace /features/notifications/ by /features/bia-features/notifications/ replace /features/users/ by /features/bia-features/users/ replace /features/users-from-directory/ by /features/bia-features/users-from-directory/

      replace import { loadAllUserOptions } by import { DomainUserOptionsActions } replace loadAllUserOptions by DomainUserOptionsActions.loadAll

      replace import { loadAllRoleOptions } by import { DomainRoleOptionsActions } replace loadAllRoleOptions by DomainRoleOptionsActions.loadAll

      replace import { loadAllNotificationTypeOptions } by import { DomainNotificationTypeOptionsActions } replace loadAllNotificationTypeOptions by DomainNotificationTypeOptionsActions.loadAll

      replace import { loadAllLanguageOptions } by import { DomainLanguageOptionsActions } replace loadAllLanguageOptions by DomainLanguageOptionsActions.loadAll

      replace import { loadDomainAppSettings } by import { DomainAppSettingsActions } replace loadDomainAppSettings by DomainAppSettingsActions.loadAll

=> some import should be resolve manually

  1. Apply other manual step (describe bellow) at the end if all is ok, you can remove the .rej files (during the process they can be useful to resolve build problem)

MANUAL STEPS

FRONT

  1. replace this.authService.getAdditionalInfos().userData.currentSiteId.toString() by this.authService.getCurrentTeamId(TeamTypeId.Site).toString() and resolve using

  2. replace this.authService.getCurrentSiteId() by this.authService.getCurrentTeamId(TeamTypeId.Site) and resolve using

  3. replace userData.CurrentSiteId by userData.GetCurrentTeamId((int)TeamTypeId.Site) and resolve using

  4. replace userData.CurrentRoleIds by userData.GetCurrentTeam((int)TeamTypeId.Site).CurrentRoleIds and resolve using

  5. replace this.authService.getAdditionalInfos().userData.currentSiteId.toString() by this.authService.getCurrentTeamId(TeamTypeId.Site).toString() and resolve using

  6. replace this.authService.getCurrentSiteId() by this.authService.getCurrentTeamId(TeamTypeId.Site) and resolve using

  7. search this.repository.Update Normally there are useless and can be commented.

    • If the item updated come form a EF request you can comment this call.
    • Else (but it should be exceptionnal) you can use the function this.repository.SetModified.
  8. If you use the Database handler feature verify it is still active in bianetconfig.json of the worker service. Now it is stop by default.

  9. Search useView = true or tableStateKey = '(+ here an not empty string)

    • This correspond to the feature where view are used.
    • You should add in the corresponding *index.component.html in bia-table-controller the parameter :
      • [useViewTeamWithTypeId]="2"
        (2 correspond to the Site TeamTypeId)

      • But the best practice is to use a parameter mapped on the enum (see example in plane feature of BIADemo):

        in *.constants.ts

        export const useViewTeamWithTypeId = TeamTypeId.Site;

        in views/-index/-index.component.ts (in the parameters of the class)

        useViewTeamWithTypeId = this.useView ? useViewTeamWithTypeId : null;

        in views/-index/-index.component.html (just add the [useViewTeamWithTypeId]="useViewTeamWithTypeId")

        <bia-table-controller
        [defaultPageSize]="defaultPageSize"
        [length]="totalCount$ | async"
        [columns]="columns"
        [columnToDisplays]="displayedColumns"
        (displayedColumnsChange)="displayedColumnsChanged($event)"
        (filter)="searchGlobalChanged($event)"
        (pageSizeChange)="onPageSizeChange($event)"
        (toggleSearch)="onToggleSearch()"
        (viewChange)="onViewChange($event)"
        [tableStateKey]="tableStateKey"
        [useViewTeamWithTypeId]="useViewTeamWithTypeId"
        ></bia-table-controller>
  10. replace getAllSites by getAllTeamsOfType(TeamTypeId.Site) and resolve using

  11. remove this.store.dispatch(loadAllSites()); or other call to loadAllSites except in site feature

  12. If you don't use the Offline mode, disable the serviceWorker in the angular.json file : "serviceWorker": false

BACK

Migrate the data:

  1. Create the migration in Package Manager Console:
 Add-Migration "V3.6.0" -Context "DataContext"
  1. Download the file V3.6.0.cs
  2. Verify that the content of the Down function of your migration is similar to the Down function of the downloaded files
    1. If ok : Replace the content of the Up function of your migration with the content of the Up function of the downloaded file.
    2. If nok : apply the similar change by following "// added manually" and "// remove manually" comment
  3. Search the TODO in the migration file and add the DropForeignKey and AddForeignKey for all object link to Site (but not in the framework). Be careful to respect the OnDelete mode (search in old migration file the mode to use)
  4. Run the migration in Package Manager Console:
Update-Database -Context "DataContext"

BUILD

no change

DEPLOY

  1. The secret key should now be passed at the deployment of the service and restart the app pool after set :

    • Change the version of the task "BIA Deploy Service as Web" used the V2
  2. Refresh the app pool after set config:

    • Change the version of the task "Deploy Web Site .Net Core" used the V4